#include <iostream>
using namespace std;
class f1_class
{
public:
    string name;
    int age;
    string phone_name;
    //
    f1_class(string name,int age,string phone_name):name(name),age(age),phone_name(phone_name){}
    void show(){
        cout<<"名字:"<<this->name<<endl;
        cout<<"年龄:"<<this->age<<endl;
        cout<<"手机:"<<this->phone_name<<endl;
    }
};
class f2_class
{
public:
    string car_name;
    int car_num;
    f2_class(string car_name,int car_num=0): car_name(car_name),car_num(car_num){}
    void show(){
        if(this->car_num==0){
            cout<<"没有车子"<<endl;
        }
        else{
            cout<<"车名:"<<this->car_name<<endl;
            cout<<"车子数量:"<<this->car_num<<endl;
        }
        
    }
};
class z_class : public f1_class,public f2_class
{
public:
    z_class(string name, int age, string phone_name, string car_name, int car_num) 
    : f1_class(name, age, phone_name), f2_class(car_name, car_num) {}
};
int main()
{
    z_class a1("张三", 20, "华为", "小米", 1);
    a1.f1_class::show();
    a1.f2_class::show();
    return 0;
}